package com.tuju.currency.network;

import com.tuju.currency.bean.resp.WXAccessToken;
import com.tuju.currency.bean.resp.WXUserInfo;

import okhttp3.ResponseBody;
import retrofit2.http.GET;
import retrofit2.http.Path;
import retrofit2.http.Query;
import rx.Observable;

public interface DataService {
    String API_BASE = "https://apihospital.ipalmap.com/";
    String OSS_BASE = "https://palmap-source.oss-cn-shanghai.aliyuncs.com/";
    String WECHAT_API = "https://api.weixin.qq.com/";

    //https://apihospital.ipalmap.com/hospital/screen/hospital?bdid=09K302&type=hp
    @GET("hospital/screen/hospital")
    Observable<Object> requestQuickItem(@Query("bdid") String bdid, @Query("type") String type);

    //===== 获取大屏配置文件
    @GET("bigscreen-buid-data/ConfigFiles/{bdid}/config.json")
    Observable<ResponseBody> updateConfig(@Path("bdid") String bdid);

    //==============================微信API=============================
    //https://api.weixin.qq.com/sns/oauth2/access_token?appid=&secret=&code=&grant_type=authorization_code
    //获取access_token
    @GET("sns/oauth2/access_token")
    Observable<WXAccessToken> getAccessToken(@Query("appid") String appid,
                                             @Query("secret") String secret,
                                             @Query("code") String code,
                                             @Query("grant_type") String type);

    //https://api.weixin.qq.com/sns/userinfo?access_token=&openid=
    //获取UserInfo
    @GET("sns/userinfo")
    Observable<WXUserInfo> getWXUserInfo(@Query("access_token") String access_token,
                                         @Query("openid") String openid);

}
